using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Windows.Documents;

namespace TrafficCountingTool.Models
{
    public class AppCache
    {
        public TimeSpan MediaFastForwardValue { get; set; }
        public bool NoMediaModeOn { get; set; }
        public bool ProjectFileOpened { get; set; }
        public bool ModifiedBeforeSaving { get; set; }
        public string ProjectFilePath { get; set; }
        public string VedioName { get; set; }
        public string MediaFilePath { get; set; }
        public VehicleTypeConfiguration VehicleTypeConfiguration { get; set; }
        public List<VehicleCounting> VehicleCountings { get; set; }

        public AppCache()
        {
            VehicleTypeConfiguration = new VehicleTypeConfiguration();
            VehicleCountings = new List<VehicleCounting>();
            ProjectFileOpened = false;
            MediaFastForwardValue = TimeSpan.FromSeconds(5);
        }

        public ProjectFile ToProjectFile()
        {
            return new ProjectFile
            {
                MediaFastForwardValue = MediaFastForwardValue,
                NoMediaModeOn = NoMediaModeOn,
                VedioName = VedioName,
                MediaFilePath = MediaFilePath,
                VehicleTypeConfiguration = VehicleTypeConfiguration,
                VehicleCountings = VehicleCountings
            };
        }
    }
}